pub trait Target {
    fn get_request(&self) {
        println!("This is target default func!");
    }
}

pub struct Adaptee {
    req_string: String,
}

impl Adaptee {
    pub fn new(s: String) -> Adaptee {
        Adaptee {req_string: s}
    }
    pub fn adaptee_request(&self) {
        println!("This is adaptee func, {}", self.req_string);
    }
}

pub(crate) struct Adapter {
    adaptee: Adaptee,
}

impl Adapter {
    pub fn new(req_string: String) -> Adapter {
        Adapter { adaptee: Adaptee::new(req_string) }
    }
}

impl Target for Adapter {
    fn get_request(&self) {
        self.adaptee.adaptee_request();
    }
}

pub(crate) struct Client;
impl Client {
    pub(crate) fn client_code<T: Target>(target: &T) {
        target.get_request();
    }
}

